import { TradeMarkResponseData, trankRes } from '@/types/permission'
import http from '@/utils/request'

enum API {
  //获取已有品牌接口
  TRADEMARK_URL = '/admin/product/baseTrademark/',
  //添加品牌
  ADDTRADEMARK_URL = '/admin/product/baseTrademark/save',
  //修改已有品牌
  UPDATETRADEMARK_URL = '/admin/product/baseTrademark/update',
  //删除已有品牌
  DELETE_URL = '/admin/product/baseTrademark/remove/',
}
//获取品牌管理菜单
export const reqTrademarkList = (page: number, limit: number) =>
  http.get<any, TradeMarkResponseData>(API.TRADEMARK_URL + `/${page}/${limit}`)

//添加品牌
export const addTrademarkAPI= (data: trankRes) => {
  return http<any,any>({
    url:API.ADDTRADEMARK_URL,
    method:'post',
    data
  })
}

//修改品牌
export const updateTrademarkAPI= (data: trankRes) => {
  return http<any,any>({
    url:API.UPDATETRADEMARK_URL,
    method:'put',
    data
  })
}
//删除品牌
export const delTrademarkAPI=(id:number)=>{
  return http<any,any>({
    url:API.DELETE_URL + id,
    method:'delete'
  })
}
